/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#include "../import/head.h"
#include "../xos/head.h"
#include "mutex_impl.h"

/////////////////////////////////////////////////////////////////////////////////////////
// 
namespace xos
{
    ////////////////////////////////////////////////////////////////////////////////////
    // 

    static mutex_impl::ITEM_DATA xos_item_data;

    ////////////////////////////////////////////////////////////////////////////////////
    //

    mutex_impl::mutex_impl()
    {
    }

    mutex_impl::~mutex_impl()
    {
        term();
    }

    ////////////////////////////////////////////////////////////////////////////////////
    // 

    int mutex_impl::get_xos_item_data( ITEM_DATA*& item_ptr )
    {
        int ret = 0;
        xos_item_data.set_container( mgr::container() );
        item_ptr = &xos_item_data;
        return ret;
    }

    int mutex_impl::init()
    {
        int nRet = 0;
        return nRet;
    }

    int mutex_impl::term()
    {
        int nRet = 0;
        return nRet;
    }

    ////////////////////////////////////////////////////////////////////////////////////
    // 

    int mutex_impl::un_lock()
    {
        int nRet = 0;
        m_lock.un_lock();
        return nRet;
    }

    int mutex_impl::lock()
    {
        int nRet = 0;
        m_lock.lock();
        return nRet;
    }
} // xos
